<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta charset="UTF-8">
<title>Insert title here</title>
<link href="static/easyui/themes/default/easyui.css" rel="stylesheet" />
<link href="static/easyui/themes/icon.css" rel="stylesheet" />
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui-lang-zh_CN.js"></script>
<script src="https://webapi.amap.com/loader.js"></script>
</head>
<body>
<%
	double lat = Double.parseDouble(request.getParameter("lat"));
	double lng = Double.parseDouble(request.getParameter("lng"));
%>
<div id="container" style="width: 100%; height: 500px"></div>
<script>
AMapLoader.load({
    "key": "84e3d9795d4be512a87855de2a0dc85e",
    // 申请好的Web端开发者Key，首次调用 load 时必填
    "version": "2.0",
    // 指定要加载的 JSAPI 的版本，缺省时默认为 1.4.15
    "plugins": [],
    // 需要使用的的插件列表，如比例尺'AMap.Scale'等
    "AMapUI": { // 是否加载 AMapUI，缺省不加载
      "version": '1.1',
      // AMapUI 版本
      "plugins": ['overlay/SimpleMarker'],
      // 需要加载的 AMapUI ui插件
    },
    "Loca": { // 是否加载 Loca， 缺省不加载
      "version": '2.0' // Loca 版本
    },
  }).then((AMap) =>{
  	// 加载逆编码插件
  	AMap.plugin('AMap.Geocoder', function() {
	  geocoder = new AMap.Geocoder()
	});
  	
    var map = new AMap.Map('container', {
      zoom: 15,
      //级别
      //中心点坐标
      center: [<%=lng%>, <%=lat%>],
      viewMode: '3D' //使用3D视图
    });
    var marker = new AMap.Marker({
		map: map,
		position:  [<%=lng%>, <%=lat%>]
	});
    
  }).
  catch((e) =>{
    console.error(e); //加载错误提示
  });
</script>
</body>
</html>